<!DOCTYPE html>
<html>
<head>
    <script src="/weblib/axios.js"></script>
    <script>
        axios.get("/api/session")
            .then(function (resp) {
                if(resp.code==="ok"){
                    let currentAccount=resp.data;
                    sessionStorage.setItem("currentAccount", JSON.stringify(currentAccount));
                    let role = currentAccount.mainRole;
                    if(role!==null){
                        location.href="/"+role.code+"-index.html";
                    }
                }else{
                    location.href="/login.html";
                }
            })
            .catch(function (err) {
                console.log(err);
                location.href="/login.html";
            });
    </script>
</head>
<body>
</body>
</html>